Package com.rnett.plugin.stdlib

The com.rnett.plugin.stdlib package provides builders for common standard library functions, using the Naming and IR Utilities features (and providing good examples of how to use them). Collections, toString and hashCode, typeOf, scope functions, numbers, and common exceptions are included. All builder methods are tested. Note that unlike for Naming, extension functions are members of their extension receiver, i.e. Map.getValue. In some cases, builders will resolve their functions based on the types of arguments, such as for number operators or nullable toString and hashCode. The receiver arguments are type checked (in IR) in most cases, the other arguments aren't.

Note that using a lot of these functions is a bad idea. If you find yourself generating a lot of code using these methods, you should probably create a utility function and call it from IR instead. The number of builders is there to provide breadth, not depth.

Types

Link copied to clipboard
class AnyBuilders(builder: IrBuilderWithScope, context: IrPluginContext) : MethodBuilder
Link copied to clipboard
class ArrayBuilders(builder: IrBuilderWithScope, context: IrPluginContext) : TypedMethodBuilder
Link copied to clipboard
open class CollectionBuilders(builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : IterableBuilders
Link copied to clipboard
class CollectionsBuilders(stdlib: StdlibBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : MethodBuilder
Link copied to clipboard
open class ExceptionBuilders(klass: ExceptionClass, builder: IrBuilderWithScope, context: IrPluginContext) : MethodBuilder
Link copied to clipboard
class ExceptionBuildersWithCause(klass: ExceptionClassWithCause, builder: IrBuilderWithScope, context: IrPluginContext) : ExceptionBuilders
Link copied to clipboard
interface ExceptionClass
Link copied to clipboard
interface ExceptionClassWithCause : ExceptionClass
Link copied to clipboard
open class IterableBuilders(builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : TypedMethodBuilder
Link copied to clipboard
object JavaLang : RootPackage
Link copied to clipboard
object JavaUtil : RootPackage
Link copied to clipboard
object Kotlin : RootPackage

A collection of References from Kotlin's standard library. Accessible in IR from com.rnett.plugin.ir.HasContext.stdlib

Link copied to clipboard
open class ListBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : CollectionBuilders
Link copied to clipboard
open class MapBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : TypedMethodBuilder
Link copied to clipboard
class MathableBuilders(mathable: Kotlin.Mathable, builder: IrBuilderWithScope, context: IrPluginContext) : NumberBuilders
Link copied to clipboard
abstract class MethodBuilder(builder: IrBuilderWithScope, context: IrPluginContext) : HasContext
Link copied to clipboard
open class MutableListBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : ListBuilders
Link copied to clipboard
open class MutableMapBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : MapBuilders
Link copied to clipboard
open class MutableSetBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : SetBuilders
Link copied to clipboard
open class NumberBuilders(builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : TypedMethodBuilder
Link copied to clipboard
open class SetBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : CollectionBuilders
Link copied to clipboard
class StdlibBuilders(builder: IrBuilderWithScope, context: IrPluginContext) : MethodBuilder

The standard library builders, accessible from from com.rnett.plugin.ir.HasContext.stdlib

Link copied to clipboard
abstract class TypedMethodBuilder(typeCheck: (IrType) -> Boolean, builder: IrBuilderWithScope, context: IrPluginContext, message: (IrExpression) -> String) : MethodBuilder